<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>
<script>
$(function(){
	$("#boardListBtn").click(function(){
		if($("#word").val().length<2){
			alert("검색어는 두 글자 이상 입력해주세요");
			return false;
		}
		location.href="${initParam.root}public/"+$("#findPublicBoard").val()+"?word="+$("#word").val();
	});
});//ready
</script>
<b style="color: red;">'${param.word }'</b> (제목) 으로 <b>정보공유</b> 대상 검색결과<br><br>
<table class="pub_list_table">
	<thead>
	<tr>
		<td width="10%">글번호</td>
		<td width="40%">제목</td>
		<td width="15%">작성자</td>
		<td width="15%">작성일</td>
		<td width="10%">조회수</td>
		<td width="10%">추천수</td>
	</tr>
	</thead>
	<tbody>
	<c:forEach items="${requestScope.plvo.list}" var="bvo">
		<tr>
			<td>${bvo.no}</td>
			<c:choose>
				<c:when test="${sessionScope.loginMember!=null }">
					<td><a
						href="${initParam.root }public/auth_detailBoard.do?no=${bvo.no}">
					<c:if test="${bvo.restep!=0}">
						<c:forEach begin="0" end="${bvo.restep}" >
						&nbsp;
					</c:forEach>
						<img src="${initParam.root }img/reply.gif">
					</c:if>
						${bvo.title}</a></td>
				</c:when>
				<c:otherwise>
					<td>
					<c:if test="${bvo.restep!=0}">
					<c:forEach begin="0" end="${bvo.restep}" >
						&nbsp;
					</c:forEach>
						<img src="${initParam.root }img/reply.gif">
					</c:if>
					${bvo.title}</td>
				</c:otherwise>
			</c:choose>
			<td>${bvo.memberVO.id}</td>
			<td>${bvo.date}</td>
			<td>${bvo.hit}</td>
			<td>${bvo.like}</td>
		</tr>
	</c:forEach>
	</tbody>
	<tfoot>
		<tr>
			<td colspan="6" align="right">
				<c:if test="${sessionScope.loginMember!=null}">
					<a href="${initParam.root }public/auth_writeBoardGo.do">글쓰기</a><br>
				</c:if>
			</td>
		</tr>
	</tfoot>
</table>
<center>
<p>
	<c:set var="pb" value="${requestScope.plvo.pagingBean}"></c:set>
	<c:if test="${pb.previousPageGroup}">
		<a href="${initParam.root}public/searchPublicBoardListByTitle.do?word=${requestScope.word}&nowPage=${pb.startPageOfPageGroup-1}">◀</a>
	</c:if>
	<c:forEach var="i" begin="${pb.startPageOfPageGroup}"
		end="${pb.endPageOfPageGroup}">
		<c:choose>
			<c:when test="${pb.nowPage!=i }">
				<a href="${initParam.root}public/searchPublicBoardListByTitle.do?word=${requestScope.word}&nowPage=${i}">${i}</a>
			</c:when>
			<c:otherwise>
				<font style="color: red; font-size: 10.5pt;">${i}</font>
			</c:otherwise>
		</c:choose>
	</c:forEach>
	<c:if test="${pb.nextPageGroup}">
		<a href="${initParam.root}public/searchPublicBoardListByTitle.do?word=${requestScope.word}&nowPage=${pb.endPageOfPageGroup+1}">▶</a>
	</c:if>
</p>
	<select id="findPublicBoard">
		<option value="searchPublicBoardListByTitle.do">제목</option>
		<option value="searchPublicBoardListByContent.do">내용</option>
		<option value="searchPublicBoardListByTitleAndContent.do">제목+내용</option>
	</select>
	<input type="search" id="word">
	<input type="button" id="boardListBtn" value="검색">
</center>
	
	
	
	
	
	
	
	
	